package o;

import android.content.Context;
import com.huawei.appgallery.foundation.card.base.bean.BaseDistCardBean;
import com.huawei.appmarket.service.appmgr.view.widget.InstallButton.InstallCardBean;
import o.ewm.n;

public class dto extends dkd {
    private coa ˏ;

    public dto(Context context) {
        super(context);
        fhz ˋ = fho.ˏ().ˋ("PackageManager");
        if (ˋ != null) {
            this.ˏ = (coa) ˋ.ॱ(coa.class);
        }
    }

    public ckg ˎ(BaseDistCardBean baseDistCardBean) {
        CharSequence string;
        cke o_cke;
        cnz o_cnz = cnz.NOT_HANDLER;
        if (this.ˏ != null) {
            o_cnz = this.ˏ.ˏ(baseDistCardBean.ॱـ());
        }
        switch (o_cnz) {
            case WAIT_INSTALL:
                string = this.ˋ.getResources().getString(n.ꜞˋ);
                o_cke = cke.WAIT_INSTALL_APP;
                break;
            case INSTALLING:
                string = this.ˋ.getResources().getString(n.ꜞˋ);
                o_cke = cke.INSTALLING_APP;
                break;
            case WAIT_UNINSTALL:
                o_cke = cke.WAIT_UNINSTALL_APP;
                string = this.ˋ.getResources().getString(n.ˌ);
                break;
            case UNINSTALLING:
                o_cke = cke.UNINSTALLING_APP;
                string = this.ˋ.getResources().getString(n.ˊˋ);
                break;
            default:
                if (!(baseDistCardBean instanceof InstallCardBean) || !((InstallCardBean) baseDistCardBean).ॱ()) {
                    o_cke = cke.INSTALL_APP;
                    string = this.ˋ.getResources().getString(n.ٴ);
                    break;
                }
                o_cke = cke.OPEN_APP;
                string = this.ˋ.getResources().getString(n.ॱˈ);
                break;
                break;
        }
        ckg o_ckg = new ckg();
        o_ckg.ˊ(string);
        o_ckg.ˋ(o_cke);
        return o_ckg;
    }
}
